﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.ComponentModel;
using System.Xml.Linq;
using Android.App;
using Android.Content;
using ICSharpCode.SharpZipLib.Zip;
using System.IO;
using ComApp.Model;
using ComApp;
using Android.Widget;
using Android.Views;

namespace AndroidApp
{
    public class PopMenuAdapter : BaseAdapter
    {
        List<String> itemListS;
        //List<int> itemListI;
        Context mcon;
        public PopMenuAdapter(Context mcon, List<String> itemListStr)
        {
            this.mcon = mcon;
            this.itemListS = itemListStr;
            //this.itemListI = itemListImg;
        }

        public override int Count
        {
            get
            {
                return itemListS.Count;
            }
        }

        public override Java.Lang.Object GetItem(int position)
        {
            return itemListS[position];
        }

        public override long GetItemId(int position)
        {
            return position;
        }

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = LayoutInflater.From(mcon).Inflate(Resource.Layout.PopupMenuItem, null);
            }
            //ImageView = (ImageView)convertView.FindViewById<ImageView>(Resource.Id.img);
            var textView = (TextView)convertView.FindViewById<TextView>(Resource.Id.textview);
            textView.Text = itemListS[position];
            //ImageView.SetBackgroundResource(itemListI[position]);
            return convertView;
        }

     
    }

}
